using UnityEngine;

public class CameraController : MonoBehaviour
{
	private static class Limit
	{
		public static int maxX;

		public static int maxY;

		public static int minX;

		public static int minY;
	}

	[Header("Requirement")]
	public new Transform transform;

	private float z;

	private void Start()
	{
		z = transform.position.z;
		Limit.minX = 12;
		Limit.maxX = Map.width * 2 - 14;
		Limit.minY = -1;
		Limit.maxY = Map.height * 2 - 14;
	}

	public void SetPosition(Vector3 position)
	{
		position.Set(Mathf.Clamp(position.x, Limit.minX, Limit.maxX), Mathf.Clamp(position.y - 9f, Limit.minY, Limit.maxY), z);
		transform.position = position;
	}
}
